#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	int s = 0;
	int v = 0;
	scanf("%d%d", &s, &v);
	int time = s / v + 10;
	if (s % v != 0)
		time++;
	int h = 1, min = 0;
	while (time >= 60)
	{
		h++;
		time -= 60;
	}
	h = 8 - h;
	if (h < 0)
		h += 24;
	min = 60 - time;
	printf("%02d:%02d", h, min);
	return 0;
}